<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../lib//js/vue.js"></script>
  <style>
    .active{
      color: red;
    }
  </style>
</head>
<body>
  <div id="root">
    <h2 :class="{active:isActive}">{{message}}</h2>
    <button @click="isActive=!isActive">切换</button>
  </div>
    <script type="text/javascript">
         const vm=new Vue({
            el:'#root',
            data:function(){
              return{
                message:'hello',
                isActive:true
              }
            },
            methods:{
  
            }
          })
        </script>
</body>
</html>